﻿namespace SimpleWorkflow.Data
{
    public class SimpleReference : IReference
    {
        public string Name { get; set; }
        public FlowContext WorkflowContext { protected get; set; }

        public SimpleReference()
        {
        }

        public SimpleReference(IReference reference)
        {
            Name = reference.Name;
        }

        public SimpleReference(string name)
        {
            Name = name;
        }

        public override int GetHashCode()
        {
            return Name.GetHashCode();
        }

        public override bool Equals(object obj)
        {
            return (obj is SimpleReference && ((SimpleReference)obj).Name == Name);
        }

    }
}
